#include "GameLayerFactory.h"
#include "Macro.h"
#include "GameLayer1.h"
#include "GameLayer2.h"
#include "GameLayer3.h"
#include "GameLayer4.h"
#include "GameLayer5.h"
#include "GameLayer6.h"
#include "GameLayer7.h"
#include "GameLayer8.h"
#include "GameLayer9.h"
#include "GameLayerBoss.h"

DECLARE_SINGLETON_MEMBER(GameLayerFactory)

GameLayerFactory::GameLayerFactory()
{
	ADD_GAME_LAYER(GameLayer1, 1);
	ADD_GAME_LAYER(GameLayer2, 2);
	ADD_GAME_LAYER(GameLayer3, 3);
	ADD_GAME_LAYER(GameLayer4, 4);
	ADD_GAME_LAYER(GameLayer5, 5);
	ADD_GAME_LAYER(GameLayer6, 6);
	ADD_GAME_LAYER(GameLayer7, 7);
	ADD_GAME_LAYER(GameLayer8, 8);
	ADD_GAME_LAYER(GameLayer9, 9);
	ADD_GAME_LAYER(GameLayerBoss, 10);
}

GameLayerFactory::~GameLayerFactory()
{

}

cocos2d::Layer* GameLayerFactory::createGameLayer(int idx)
{
	return m_vecGameLayer[idx - 1]();
}

void GameLayerFactory::addLayer(std::function<cocos2d::Layer*()> callback)
{
	m_vecGameLayer.push_back(callback);
}